package com.gyt.data.dao.risk;



import com.gyt.framework.domain.function.result.FunctionInfoResult;
import com.gyt.framework.domain.function.result.FunctionRelatedSceneResult;
import com.gyt.framework.domain.function.risk.FunctionLibraryInfo;
import com.gyt.framework.domain.function.risk.FunctionLibraryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author v_yantgao
 */
@Mapper
public interface FunctionMapper {

    Integer addFunctionTypeInfo(FunctionLibraryInfo record);

    Integer updateFunctionTypeInfo(FunctionLibraryInfo record);

    List<FunctionLibraryInfo> getFunctionLibraryAllInfo();
    /**
     * 根据主键查询函数类型信息
     * @param id
     * @return
     */
    FunctionLibraryInfo getFunctionLibraryInfoById(Integer id);

    /**
     * 根据函数id批量删除
     * @param functionIdList
     * @param userName
     * @return
     */
    int batchDelFunctionByIds(@Param("functionIdList") List<Integer> functionIdList,
                              @Param("userName") String userName);

    /**
     * 查询函数类型集合
     * @param map
     * @return
     */
    List<FunctionLibraryInfo> findFunctionTypeInfo(Map<String, Object> map);

    /**
     * 查询已关联函数集合
     * @param map
     * @return
     */
    List<FunctionInfoResult> findRelatedFunctionList(Map<String, Object> map);

    /**
     * 根据函数id查询函数参数集合
     * @param functionId
     * @return
     */
    List<FunctionLibraryParam> queryParamsByFunctionId(@Param("functionId") Integer functionId);

    /**
     * 根据函数id查询有出参的函数集合
     * @param functionId
     * @return
     */
    List<FunctionLibraryParam> queryFunctionOutParamList(@Param("functionId") Integer functionId, @Param("paramType") Integer paramType);

    List<FunctionRelatedSceneResult> getRelatedFunsBySceneId(Map<String, Object> map);
}
